<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>
<script src="https://cdn.bootcss.com/vue/2.3.4/vue.js"></script>
<div id="root">
	
</div>
<script>
	//例如 methods, components 和 directives，将被混合为同一个对象。 两个对象键名冲突时，取组件对象的键值对。
var mixin = {
  methods: {
    foo: function () {
      console.log('foo')
    },
    conflicting: function () {
      console.log('from mixin')
    }
  }
}
var vm = new Vue({//组件
  mixins: [mixin],
  methods: {
    bar: function () {
      console.log('bar')
    },
    conflicting: function () {
      console.log('from self')
    }
  }
})
console.log(vm.foo()) // -> "foo"
console.log(vm.bar()) // -> "bar"
console.log(vm.conflicting()) // -> "from self"
</script>
</body>
</html>